import Cookies from 'js-cookie'

const COOKIE_NAME = process.env.VUE_APP_TOKEN_NAME

const LOGIN_BACK_URL_NAME = 'LOGIN_BACK_URL_NAME'

const USER_INFO ='USER_INFO'

//存储TOKEN
export function setToken(token) {
    Cookies.set(COOKIE_NAME,token)
}

//获取TOKEN
export function getToken() {
    return Cookies.get(COOKIE_NAME)
}

//存储登录回调地址
export function setLoginBackUrl(backUrl) {
    Cookies.set(LOGIN_BACK_URL_NAME,backUrl)
}

//获取回调地址
export function getLoginBackUrl() {
   return Cookies.get(LOGIN_BACK_URL_NAME)
}

//获取渠道ID
export function setChannelId(id) {
    Cookies.set('CHANNELID',id)
}


export function getChannelId() {
   return Cookies.get('CHANNELID')
}

export function setUserInfo(userInfo) {
    Cookies.set(USER_INFO,userInfo)
}

export function getUserInfo() {
    return Cookies.get(USER_INFO)
}
